<?php $theme->display ( 'header' ); ?>
<!-- tumble -->
	<section id="articles">
		<article>
		    <header>
        		<h1>//Tumbel Archives</h1>
        		<p>My huge file cabinet storing everything old</p>
			</header>
			<section>
				<?php 
					if( !empty( $theme->tumblearchive ) ) {
						foreach( $theme->tumblearchive as $y=>$year ) {
							printf( "<h3><a href=\"%s\">" . _t( 'Year: %d(%d)' ) . "</a></h3>\n", $year[ "url" ], $y, $year[ "count" ] );
							foreach( $year["months"] as $m=>$month ) {
								printf( '<h4 class="exp"><a href="%s">' . _t( '%s (%d)' ) . '</a></h4><ul class="tumble-archive">', $month[ "url" ], 
								date( "F", mktime(0, 0, 0, $m, 1, 2000 ) ), $month[ "count" ] );		
								foreach( $month["days"] as $d=>$day ) {
									foreach( $day["posts"] as $p=>$post ) {
										if($post instanceOf Post) {
											printf( "<li>" . _t( '<a href="%s"><span>%s: %s</span><span class="hover">%s</span></a>' ) . "</li>\n", $post->permalink, $post->title, $post->entry, date( "M dS", mktime( 0, 0, 0, $m, $d, $y ) ) );
										}
									}
								}
								echo "</ul>";
							}
						}
					}
				?>
			</section>
		</article>
	</section>

<!-- /tumble -->
<?php //$theme->display( 'sidebar' ); ?>
<?php $theme->display( 'footer' ); ?>